
CC = gcc
LD = gcc
LDFLAGS = 
CCFLAGS = 
DIR_BIN = ../bin
DIR_WORK = ./intermediates
OBJECTS = $(DIR_WORK)/myshell.o

all: myshell clr dir ech pause slp

myshell: $(OBJECTS)
	$(LD) $(LDFLAGS) -o $(DIR_BIN)/myshell $(OBJECTS)

clr: $(DIR_WORK)/clr.o
	$(LD) $(LDFLAGS) $< -o $(DIR_BIN)/clr

dir: $(DIR_WORK)/dir.o
	$(LD) $(LDFLAGS) $< -o $(DIR_BIN)/dir

ech: $(DIR_WORK)/ech.o
	$(LD) $(LDFLAGS) $< -o $(DIR_BIN)/ech

pause: $(DIR_WORK)/pause.o
	$(LD) $(LDFLAGS) $< -o $(DIR_BIN)/pause

slp: $(DIR_WORK)/slp.o
	$(LD) $(LDFLAGS) $< -o $(DIR_BIN)/slp

environ: $(DIR_WORK)/environ.o
	$(LD) $(LDFLAGS) $< -o $(DIR_BIN)/environ

$(DIR_WORK)/%.o: ./%.c
	$(CC) $(CCFLAGS) -c $< -o $@

clean:
	rm -f $(DIR_BIN)/myshell
	rm -f $(DIR_BIN)/clr
	rm -f $(DIR_WORK)/*.o


